package com.wj.jiangan.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wj.jiangan.mapper.StockMapper;
import com.wj.jiangan.pojo.Stock;
import com.wj.jiangan.service.IStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author wj
 * @since 2019-11-05
 */
@Service
public class StockServiceImpl implements IStockService {

    @Autowired
    private StockMapper stockMapper;

    @Override
    public Stock getStockByPid(Integer pid) {

        QueryWrapper<Stock> qw = new QueryWrapper<>();
        qw.eq("p_id", pid);
        return stockMapper.selectOne(qw);
    }
}
